<?php
    class BaseException extends Exception {
        protected $_data = array(
            "class" => null
        );
        
        public function __get($key) {
            $result = null;            
            if (array_key_exists($key,$this->_data)) {
                $result = $this->_data[$key];
            }            
            return $result;
        }
        
        public function __construct($message,$code = 0,$class = null,
                Exception $previous = null) {
            $this->_data["class"] = $class;
            parent::__construct($message,$code,$previous);
        }
    }